      SUBROUTINE FRMSTD ( VALIN, STRIN, VALOUT, STROUT, IERR )
C*
C*                  *******************************
C*                  *******************************
C*                  **                           **
C*                  **          FRMSTD           **
C*                  **                           **
C*                  *******************************
C*                  *******************************
C*
C*     SUBPROGRAM :
C*          FROM STANDARD UNITS
C*
C*     AUTHOR :
C*          ART RAGOSTA
C*          MS 207-5
C*          AMES RESEARCH CENTER
C*          MOFFETT FIELD, CA  94035
C*          (415) 694-5578
C*
C*     PURPOSE :
C*          TO CONVERT A VALUE FROM STANDARD UNITS TO NON-STANDARD UNITS
C*
C*     INPUT ARGUMENTS :
C*          VALIN  - THE INPUT VALUE
C*          STRIN  - THE UNITS OF 'VALIN'
C*          STROUT - THE REQUESTED UNITS OF 'VALOUT'
C*
C*     OUTPUT ARGUMENTS :
C*          VALOUT - THE VALUE AFTER CONVERTING
C*          IERR   -=0 FOR NO ERROR
C*                  =1-3 FOR ERROR IN TOSTD
C*                  =4 FOR INVALID UNITS REQUESTED (IE, OUTPUT UNITS DO
C*                      NOT FOLLOW FROM INPUT UNITS)
C*
C*     INTERNAL WORK AREAS :
C*          STEMP - USED TO CALCULATE THE RESULTANT STD UNITS
C*
C*     COMMON BLOCKS :
C*          NONE
C*
C*     FILE REFERENCES :
C*          NONE
C*
C*     SUBPROGRAM REFERENCES :
C*          TOSTD, CMPAR
C*
C*     ERROR PROCESSING :
C*          NONE
C*
C*     TRANSPORTABILITY LIMITATIONS :
C*          NONE
C*
C*     ASSUMPTIONS AND RESTRICTIONS :
C*          NONE
C*
C*     LANGUAGE AND COMPILER :
C*          ANSI FORTRAN 77
C*
C*     VERSION AND DATE :
C*          VERSION I.0     24-SEP-85
C*
C*     CHANGE HISTORY :
C*          24-SEP-85    INITIAL VERSION
C*
C***********************************************************************
C*
      CHARACTER *(*) STRIN, STROUT
      CHARACTER *255 STEMP
C
C --- USE TOSTD TO CALCULATE THE CONVERSION FACTOR FOR STROUT
C
      VTEMP = 1.0
      CALL TOSTD ( VTEMP, STROUT, VTEMP, STEMP, IERR )
      IF ( IERR .NE. 0 ) RETURN
C
C --- VTEMP HAS THE FACTOR FOR THE NON-STD UNITS...
C ---  DIVIDE AND MAKE SURE THE UNITS ARE THE SAME
C
      CALL CMPAR ( STRIN, STEMP, IERR )
      IF (IERR .EQ. 0) VALOUT = VALIN / VTEMP
      RETURN
      END
C
C---END FRMSTD
C
